<?php

/**
 * @author Rizky Tahara Shita
 * @website http://tahara.web.id
 * @email rizky.tahara@gmail.com
 * @copyright b'IT Cyber Solution
 */

class M_live_forms extends BZ_Model
{
	function __construct()
	{
		parent::__construct();

		/**
		 * @description load the models
		 */
		$this->load->model('admin/M_layout');
	}


/**
 * @section biskitZ Live Forms Model
 */

	/**
	 * @function media()
	 * @description generate the media forms for uploading to biskitZ attachment
	 */
	public function media($prm_heading_title = '', $prm_column = '2')
	{
		/**
		 * @section begin form MODAL initalize
		 */
			/**
			 * @description create the MODAL form and elements
			 */
			$form_modal_content = array
				(
					'<b>'.$this->lang->line('fields_tools_language_name').'</b><br /><small>'.$this->lang->line('fields_required').'</small>'
					, form_input
						(
							array
							(
								'type' => 'hidden'
								, 'name' => 'txtinput[70]', 'id' => 'txt70'
								, 'size' => '3', 'maxlength' => '3'
								, 'readOnly' => 'readOnly', 'class' => '{validate: {required: true}} read_only'
							)
							, ''
							, 'onFocus="javascript: $(\'#txt71\').focus().select();"'
						)
						. form_input
							(
								array
								(
									'name' => 'txtinput[71]', 'id' => 'txt71'
									, 'size' => '30', 'maxlength' => '30'
									, 'title' => $this->lang->line('fields_tools_language_name')
								)
							)
						. '<br /><small><i>'.$this->lang->line('fields_acomplete_note').'</i></small>'

					, '<b>'.$this->lang->line('fields_front_tools_media_title').'</b><br /><small>'.$this->lang->line('fields_required').'</small>'
					, form_input
						(
							array
							(
								'name' => 'txtinput[72]', 'id' => 'txt72'
								, 'size' => '45', 'maxlength' => '255'
								, 'class' => '{validate: {required: true}}'
								, 'title' => $this->lang->line('fields_front_tools_media_title')
							)
						)

					, '<b>'.$this->lang->line('fields_front_tools_media_description').'</b>'
					, form_input
						(
							array
							(
								'name' => 'txtinput[73]', 'id' => 'txt73'
								, 'size' => '55', 'maxlength' => '255'
								, 'title' => $this->lang->line('fields_front_tools_media_description')
							)
						)

					, '<b>'.$this->lang->line('fields_front_tools_media_choose_file').'</b><br /><small>'.$this->lang->line('fields_required').'</small>'
					, form_input
						(
							array
							(
								'type' => 'hidden'
								, 'name' => 'txtinput[74]', 'id' => 'txt74'
								, 'readOnly' => 'readOnly', 'class' => 'read_only'
							)
							, ''
							, 'onFocus="javascript: $(\'#txt500\').focus().select();"'
						)
						. form_input
							(
								array
								(
									'type' => 'hidden'
									, 'name' => 'txtinput[75]', 'id' => 'txt75'
									, 'readOnly' => 'readOnly', 'class' => 'read_only'
								)
								, ''
								, 'onFocus="javascript: $(\'#txt500\').focus().select();"'
							)
						. form_upload
							(
								array
								(
									'name' => 'txtupload_file', 'id' => 'txt500'
									, 'size' => '30'
									, 'class' => '{validate: {accept:\''.$this->web_data['BISKITZ']['SETTINGS']['BISKITZ_UPLOAD_TYPE_ALLOWED'].'\'}}'
								)
							)


					, '&nbsp;'
					, form_submit
						(
							array
							(
								'id' => 'btn_modal_media_save'
								, 'title' => $this->lang->line('button_upload')
							)
							, $this->lang->line('button_upload')
						)
				);
			/**
			 * @description create the form MODAL and elements
			 */
			$this->table->clear();
			$form_modal_content = $this->table->make_columns($form_modal_content, $prm_column);
			$form_modal_content = $this->table->generate($form_modal_content);
		/**
		 * @section begin form MODAL initalize
		 */

		$return_value = array
			(
				'FORM_MODAL' => array
					(
						'OPEN' => form_open('', array('id' => 'frm_modal_media', 'onSubmit' => 'return false'), '')
						, 'TITLE' => $prm_heading_title
						, 'CONTENT' => $form_modal_content
					)
				, 'NOTES_MODAL' => array
					(
						'USE' => 'TRUE'
						, 'MESSAGE' => array
							(
								'SHORTCUTS' => $this->lang->line('notes_modaldialog_shortcuts')
								, 'ADDITIONAL' => ''
							)
					)
			);


		$return_value = $this->M_layout->modaldialog_generate($return_value);
		echo $return_value;
	}


	/**
	 * @function category_detail()
	 * @description generate the category detail forms
	 */
	public function category_detail($prm_key = '', $prm_heading_title = '', $prm_lang_category_name = '', $prm_lang_category_description = '', $prm_column = '2')
	{
		/**
		 * @section begin form MODAL initalize
		 */
			/**
			 * @description create the MODAL form and elements
			 */
			$form_modal_content = array
				(
					'<b>'.$this->lang->line('fields_tools_language_name').'</b><br /><small>'.$this->lang->line('fields_required').'</small>'
					, form_input
						(
							array
							(
								'type' => 'hidden'
								, 'name' => 'txtinput[70]', 'id' => 'txt70'
								, 'size' => '5', 'maxlength' => '5'
								, 'readOnly' => 'readOnly', 'class' => 'read_only'
							)
							, $prm_key
							, 'onFocus="javascript: $(\'#txt72\').focus().select();"'
						)
						. form_input
							(
								array
								(
									'type' => 'hidden'
									, 'name' => 'txtinput[71]', 'id' => 'txt71'
									, 'size' => '3', 'maxlength' => '3'
									, 'readOnly' => 'readOnly', 'class' => '{validate: {required: true}} read_only'
								)
								, ''
								, 'onFocus="javascript: $(\'#txt72\').focus().select();"'
							)
						. form_input
							(
								array
								(
									'name' => 'txtinput[72]', 'id' => 'txt72'
									, 'size' => '30', 'maxlength' => '30'
									, 'title' => $this->lang->line('fields_tools_language_name')
								)
							)
						. '<br /><small><i>'.$this->lang->line('fields_acomplete_note').'</i></small>'


					, '<b>'.$this->lang->line($prm_lang_category_name).'</b><br /><small>'.$this->lang->line('fields_required').'</small>'
					, form_input
						(
							array
							(
								'name' => 'txtinput[73]', 'id' => 'txt73'
								, 'size' => '30', 'maxlength' => '30'
								, 'class' => '{validate: {required: true}}'
								, 'title' => $this->lang->line($prm_lang_category_name)
							)
						)

					, '<b>'.$this->lang->line($prm_lang_category_description).'</b>'
					, form_input
						(
							array
							(
								'name' => 'txtinput[74]', 'id' => 'txt74'
								, 'size' => '50', 'maxlength' => '255'
								, 'title' => $this->lang->line($prm_lang_category_description)
							)
						)


					, '&nbsp;'
					, form_submit
						(
							array
							(
								'id' => 'btn_modal_save'
								, 'title' => $this->lang->line('button_save')
							)
							, $this->lang->line('button_save')
						)
				);
			/**
			 * @description create the form MODAL and elements
			 */
			$this->table->clear();
			$form_modal_content = $this->table->make_columns($form_modal_content, $prm_column);
			$form_modal_content = $this->table->generate($form_modal_content);
		/**
		 * @section end form MODAL initalize
		 */


		/**
		 * @section begin generate template variables
		 */
		$return_value = array
			(
				/**
				 * @description form modal dialogs
				 */
				'FORM_MODAL' => array
					(
						'OPEN' => form_open('', array('id' => 'frm_modal', 'onSubmit' => 'return false'), '')
						, 'TITLE' => $prm_heading_title
						, 'CONTENT' => $form_modal_content
					)

				/**
				 * @description notes modaldialog
				 */
				, 'NOTES_MODAL' => array
					(
						'USE' => 'TRUE'
						, 'MESSAGE' => array
							(
								'SHORTCUTS' => $this->lang->line('notes_modaldialog_shortcuts')
								, 'ADDITIONAL' => ''
							)
					)
			);
		/**
		 * @section end generate template variables
		 */


		$return_value = $this->M_layout->modaldialog_generate($return_value);
		echo $return_value;
	}



}

/** End of file M_live_forms.php */
/** Location: ./biskitz_mpc/biskitz/models/admin/biskitz/front_end/m_live_forms.php */